package June;

public class Test08UtilClass {
    //私有化构造方法
    //目的：不让外界创造它的对象
    private Test08UtilClass(){}

    //定义为静态方法，方便调用。该类又称工具类
    public static String printArr(int[] arr){
        StringBuilder sb=new StringBuilder();
        sb.append("[");
        for (int i = 0; i < arr.length; i++) {
            if (i==arr.length-1){
                sb.append(arr[i]);

            }else {
                sb.append(arr[i]).append(",");
            }
        }
        sb.append("]");
        return sb.toString();
    }
    //静态（static）只能调用静态

    public static void temp(){
        System.out.println(111);
    }
}
